草庐IT

miui14 root

全部标签

ruby - 带有 sinatra 的 Heroku 没有 RAILS_ROOT 或 Rail.root

我正在尝试将文件上传到amazons3,显然我必须先写入一个临时文件,然后再上传该文件。但是我无法弄清楚如何使用Sinatra和heroku做到这一点,因为它找不到“#{RAILS_ROOT}”或#{Rail.root}如何使用heroku将临时文件上传到sinatra。谢谢 最佳答案 我假设您已经阅读了Heroku的UploadingtoS3文档.Heroku上的临时目录路径是./tmp。如果您运行的是Sinatra,Heroku可能不会创建与Rails相关的环境变量(尽管我不确定是否可能)。Here是关于Heroku文件系统的更

ruby-on-rails - ubuntu 14.04 上 passenger-install-nginx-module 的 Bundler 错误

我正在ubuntu14.04和ruby2.2.4上安装passenger+nginx。passenger-install-nginx-module有bundler错误$passenger-install-nginx-module/home/ubuntu/.rvm/gems/ruby-2.2.4/gems/bundler-1.13.1/lib/bundler/rubygems_ext.rb:45:in`full_gem_path':uninitializedconstantBundler::Plugin::API::Source(NameError)from/home/ubuntu/.r

ruby - rbenv 和 passenger - 无法从非 root 用户帐户(sudo 组)安装

我只是想在Ubuntu12.04上设置我的第一个Rails服务器。我安装了rbenv(作为用户:deployer组sudo和admin)。现在尝试根据他们的文档安装乘客。我运行passenger-install-nginx-module它开始了,但是我得到了Pleasespecifyaprefixdirectory[/opt/nginx]:--------------------------------------------PermissionproblemsThisinstallermustbeabletowritetothefollowingdirectory:/opt/ngin

ruby - `selenium-webdriver` ruby​​ gem 无法与 Ubuntu 14.04 上的 chromedriver 连接

我正在运行Ubuntu16.04,我正在尝试使用chromedriver在ruby​​中运行headlessChrome浏览器。我已经使用theseinstructions在Ubuntu上安装了chromedriver然后我通过ruby​​irb控制台运行它:require'selenium-webdriver'options=Selenium::WebDriver::Chrome::Options.newoptions.add_argument('--headless')@driver=Selenium::WebDriver.for(:chrome,options:options)T

Ruby,如何引用 Root 命名空间?

当我有这样的模块时:moduleMyModuleclassMyClassendend我可以访问/修改引用它的MyModule:MyModule.const_set("MY_CONSTANT","value")但是Root命名空间,::命名空间呢?我正在寻找类似的东西:::.const_set("MY_CONSTANT","value")const_set只是一个例子,请不要尝试解决这个具体情况,而是实际引用Root命名空间的方式 最佳答案 什么是根对象?如果您指的是main对象,则不能在此级别设置常量:TOPLEVEL_BINDIN

ruby-on-rails - 在 Ubuntu 14.04 上安装 Jekyll

我在Ubuntu上安装Jekyll时遇到了一些问题。以下是我拥有的一些版本:trevor~$ruby-vruby2.2.4p230(2015-12-16revision53155)[x86_64-linux]trevor~$gem-v2.5.1trevor~$rvm-vrvm1.26.11(latest)byWayneE.Seguin,MichalPapis[https://rvm.io/]但是,当我尝试安装Jekyll时,出现以下错误:trevor~$geminstalljekyllBuildingnativeextensions.Thiscouldtakeawhile...ERRO

ruby-on-rails - rails 路线 : define root to namespace

我有2个Controller:app//controllersposts_controllers.rb/mobileposts_controllers.rb我的routes.rb看起来像这样:root:to=>"posts#index"resources:postsnamespace:mobiledoroot:to=>"posts#index"resources:postsend但是当我访问/mobile时,它无论如何都会渲染第一个Controller的索引页面,也试过这个:namespace:mobiledoroot:to=>"mobile/posts#index"resources

ruby-on-rails - Puma 和 Nginx 502 Bad Gateway 错误(Ubuntu 服务器 14.04)

我需要部署我的Rails应用程序,所以我从这里开始执行了所有步骤,https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04但是在教程结束时,我得到了这个错误-->“502BadGateway”编辑现在的错误消息-->“很抱歉,出了点问题。”但是Nginx错误输出是相同的,我检查了puma错误消息,但它们只是记录它何时启动以及何时正常停止。位于app_directory/log下的Rails日志不产生任何输出。puma-man

ruby - 无法在 ubuntu 14.04 lts 上安装 fileutils Rubygem

当尝试安装fileutilsgem时,我得到以下输出:Nopackage'MagickCore'foundPackageMagickCorewasnotfoundinthepkg-configsearchpath.Perhapsyoushouldaddthedirectorycontaining`MagickCore.pc'tothePKG_CONFIG_PATHenvironmentvariableNopackage'MagickCore'foundPackageMagickCorewasnotfoundinthepkg-configsearchpath.Perhapsyoushou

ruby - 更新到 cocoapods 0.32.1 后无法运行 sudo pod install,错误为 "You cannot run CocoaPods as root. (CLAide::Help)"

我在更新到最新版本0.32.1后运行sudopodinstall命令时发现了一个问题。早些时候它工作得很好。当我尝试使用旧的cocoapods安装pod时,它要求我更新到最新的cocoapods版本,即0.32.1。在我通过cocoapodsgem更新后,我无法在我的Xcode项目中执行sudopodinstall。它给了我以下错误。±sudopodinstallruby-1.9.3-p0Password:/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/claide-0.5.0/lib/claide/